If (i <= MaxRoundrectangle) And (DataRoundrectangle(i) = 1) Then
If (X >= Roundrectangle1(i).Left) And (X < Roundrectangle1(i).Left + Roundrectangle1(i).Width) And (Y >= Roundrectangle1(i).Top) And (Y < Roundrectangle1(i).Top + Roundrectangle1(i).Height) Then
If (i <= MaxRectangle) And (DataRectangle(i) = 1) Then
If (X >= Rectangle1(i).Left) And (X < Rectangle1(i).Left + Rectangle1(i).Width) And (Y >= Rectangle1(i).Top) And (Y < Rectangle1(i).Top + Rectangle1(i).Height) Then